package org.xelnaga.defiler.service;

import java.util.ArrayList;
import java.util.List;

import org.xelnaga.defiler.domain.ContentletModel;

/**
 * This is a class used to store (in session) contentlets relationships matches during a contentlet edition
 * @author David
 *
 */
public class ContentletRelationships<T> {
	
	private static final long serialVersionUID = 1L;
	
	private ContentletModel contentlet;
	private List<ContentletRelationshipRecords<T>> relationshipsRecords;
	
	
	/**
	 * @param contentlet
	 * @param relationshipsRecords
	 */
	public ContentletRelationships(ContentletModel contentlet, List<ContentletRelationshipRecords<T>> relationshipsRecords) {
		this.contentlet = contentlet;
		this.relationshipsRecords = relationshipsRecords;
	}
	
	
	/**
	 * @param contentlet
	 */
	public ContentletRelationships(ContentletModel contentlet) {
		this.contentlet = contentlet;
		this.relationshipsRecords = new ArrayList<ContentletRelationshipRecords<T>> ();
	}


	/**
	 * @return Returns the relationshipsRecords.
	 */
	public List<ContentletRelationshipRecords<T>> getRelationshipsRecords() {
		return relationshipsRecords;
	}
	/**
	 * @param relationshipsRecords The relationshipsRecords to set.
	 */
	public void setRelationshipsRecords(
			List<ContentletRelationshipRecords<T>> relationshipsRecords) {
		this.relationshipsRecords = relationshipsRecords;
	}
	/**
	 * @return Returns the contentlet.
	 */
	public ContentletModel getContentlet() {
		return contentlet;
	}
	/**
	 * @param contentlet The contentlet to set.
	 */
	public void setContentlet(ContentletModel contentlet) {
		this.contentlet = contentlet;
	}
}
